<template>
  <div style="background-color: #999">
    <h2>女儿金钱:{{ daughterMoney }}</h2>
    <button @click="giveFatherMoney(100)">给父亲100</button>
  </div>
</template>

<script>
export default {
  name: "Daughter",
  data() {
    return {
      daughterMoney: 18000,
    };
  },
  methods: {
    giveFatherMoney(money) {
      this.$parent.fatherMoney += money;
      this.daughterMoney -= money;
    },
  },
};
</script>

<style>
</style>